﻿@model PageList<EquipmentListModel>
@{
    ViewBag.Title = "备案设备列表";
}
@section BodyNav
{
    > @Html.ActionLink("备案设备列表", "List", "Equipment")
}
<table class="list">
    <tr class="head">
        <th width="275">
            操作
        </th>
        <th>
            备案编号
        </th>
        <th>
            报检号
        </th>
        <th>
            产权单位
        </th>
        <th width="70">
            设备名称
        </th>
        <th>
            设备型号
        </th>
        <th>
            合格证号
        </th>
        <th>
            出厂日期
        </th>
        <th>
            出厂代号
        </th>
        <th>
            状态
        </th>
        <th>
            设计年限
        </th>
        <th>
            已用年限
        </th>
        <th>
            打印
        </th>
    </tr>
    @foreach (var m in Model)
    {
        <tr @Html.Raw((m.IsNearlyExpire) ? "class=\"nearlyExpired\"" : "")>
            <td>
                @Html.ActionLink("查看", "Detail", new { id = m.Id }, new { @class = "lnkDetail" })
                @Html.ActionLink("修改联系人", "EditContactor", new { id = m.Id }, new { @class = "lnkDetail" })
                @if (UserAuthnicationHelper.CurrentUserType >= UserTypes.Admin)
                {
                    @Html.ActionLink("修改", "Edit", new { Id = @m.Id }, new { @class = "lnkDetail" })    
                }
                @if (UserAuthnicationHelper.CurrentUserType >= UserTypes.Operator)
                {
                    @Html.ActionLink("归档", "Archive", "Equipment", new { id = m.Id }, new { @class = "lnkArchive" })
                    @Html.ActionLink("删除", "Delete", new { id = m.Id }, new { @class = "lnkDel" })
                    if (m.Eq_Status != EquipmentStatus.Destoryed)
                    {
                    @Html.ActionLink("报废", "Destory", new { id = m.Id }, new { @class = "LnkDestory" })
                    }
                    if (!m.Eq_IsPrinted)
                    {
                    @Html.ActionLink("打印", "Print", new { id = m.Id }, new { @class = "lnkPrint" })
                    }
                }
            </td>
            <td>@m.NO
            </td>
            <td>@m.InspectNO
            </td>
            <td>@m.Eq_Owner
            </td>
            <td>@m.Eq_Name
            </td>
            <td>@m.Eq_Type
            </td>
            <td>@m.Eq_CertNo
            </td>
            <td>@m.Eq_MadeDate.ToString("yyyy-MM-dd")
            </td>
            <td>@m.Eq_MadeNo
            </td>
            <td>
                @m.StatusString
            </td>
            <td>@m.Eq_LimitMonths 年
            </td>
            <td>@m.Eq_HaveUsedMonths 年
            </td>
            <td>@Html.Raw(m.Eq_IsPrinted ? "是" : "")
            </td>
        </tr>
    }
</table>
<div class="pager">
    @Html.Raw(Html.Pager("page", Model.PageIndex, Model.PageSize, Model.TotalCount))
</div>
